import requests
from flask import Flask, request, jsonify

# 假设从 flag.py 文件中导入了 flag 函数
app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def getinfo():
    url = request.args.get('url')
    if url:
        # 请求url
        response = requests.get(url)
        print(1)
        content = response.text
        print(content)
        if "paluctf" in content:
            return '1'
        else:
            return content
    else:
        response = {
            'message': 200,  # 这里是数值，不是字符串
            'data': "Come sign in and get the flag!"
        }
        return jsonify(response)

@app.route('/flag', methods=['GET', 'POST'])
def flag1():
    return "paluctf"

if __name__ == '__main__':
    app.run(debug=True, host="0.0.0.0", port=80)
